﻿using UnityEngine;

namespace Room
{
    class ServerMonsterAIStateBattle : ServerMonsterAIStateBase
    {
        GameObject att;
        protected override void OnEnter()
        {
            base.OnEnter();
            controller.owner.PlayAnim("standfight");

            att = GameObjectPoolManager.Instance.Spawn(RoomField.particleAttAb, CommonMethod.GetAssetNameFromAssetBundleName(RoomField.particleAttAb) );
            att.transform.SetParent(controller.owner.transform);
            att.transform.localScale = Vector3.one;
            att.transform.localPosition = Vector3.zero + new Vector3(0, 2, 0);
            att.SetActive(true);
        }

        protected override void OnLeave()
        {
            controller.owner.PlayAnim("stand");
            GameObjectPoolManager.Instance.Unspawn(att);
        }
    }
}
